//
// Created by alexa on 5/13/2024.
//

#ifndef ARTILLERYSYSTEM_BATTALIONSSERVICE_H
#define ARTILLERYSYSTEM_BATTALIONSSERVICE_H


#include "../../repositories/battalion-repository/BattalionRepository.h"
#include "../crews-service/CrewsService.h"
#include "../combat-units-service/UnitsService.h"

class BattalionsService {
private:
    BattalionRepository repository;
    UnitsService *unitsService;
public:
    explicit BattalionsService(UnitsService *unitsService);

    Battalion *getById(string id);

    vector<Battalion *> getAll();

    Battalion *createOne(string name);

    void deleteOne(string id);

    void addCombatUnit(string battalionId, string unitId);

    void removeCombatUnit(string battalionId, string unitId);

    vector<CombatUnit *> getUnitsInBattalion(string battalionId);

    Battalion *findByUnitId(string unitId);

    void saveBattalion(Battalion* battalion);

    friend class MainService;
};


#endif //ARTILLERYSYSTEM_BATTALIONSSERVICE_H
